/*
 *  ICE_View_Interface.h
 *  ICE_Player
 *
 *  Created by xl on 11-6-25.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef ICE_VIEW_INTERFACE_H
#define ICE_VIEW_INTERFACE_H

#import <UIKit/UIKit.h>

#define MAX_ICE_STRING_LEN (2048)

typedef enum {
    DVC_TYPE_IPHONE3 = 0,
    DVC_TYPE_IPHONE4 = 1,
    DVC_TYPE_IPAD = 2,
}DEVICE_TYPE;

DEVICE_TYPE get_device_type();

@protocol ICE_Globalize_Protocol

@property int32_t globalize_id;

@end

@protocol  ICE_View_Protocol <ICE_Globalize_Protocol>

- (void)create_SubViews:(UIViewController*)controller;
- (void)destroy_SubViews;
- (void)scale_to_fit_iPhone4;
- (void)scale_to_fit_iPhone3;
- (void)scale_to_fit_iPad;

@end

@interface ICE_View : UIView <ICE_View_Protocol>
{
}
@end

@interface ICE_Image_View : UIImageView <ICE_View_Protocol>
{
}
@end

@interface ICE_Button_View : UIButton <ICE_View_Protocol>
{
}
@end

@interface ICE_Label_View : UILabel <ICE_View_Protocol>
{
}
@end

@interface ICE_Hidable_Label_View : ICE_Label_View
{
    BOOL hidden_outside;
}
@property BOOL hidden_outside;
+ (void)Enable_Hide_All:(BOOL)enabled;
@end

@interface ICE_Table_View : UITableView <ICE_View_Protocol>
{
}
@end

@interface ICE_Switch_View : UISwitch <ICE_View_Protocol>
{
}
@end

@interface ICE_View_Controller : UIViewController
{
}
@end


@interface  ICE_Table_View_Manager: UITableViewController
{
}
@end


@interface ICE_Table_View_Cell : UITableViewCell <ICE_View_Protocol>
{
}
@end

@interface ICE_Text_Feild: UITextField <ICE_View_Protocol>
{
}
@end

@interface ICE_String : NSObject <ICE_Globalize_Protocol>
{
    char* string;
    int length;
}
@property char* string;
@property int length;

- (void)replaceAllString:(NSString*)str;
@end

@interface ICE_Image : UIImage <ICE_Globalize_Protocol>
{
}
@end

#ifndef NULL
#define NULL 0
#endif

#define RELEASE_ICE_VIEW(x) if(x){[x removeFromSuperview];[x destroy_SubViews];[x release];x = NULL;}
#define CREATE_ICE_VIEW(x,class,controller) if(!x) {x = [class new];} {[controller.view addSubview:x];[x create_SubViews:controller];}
#define CREATE_ICE_VIEW_GLOBALIZE(x,class,controller,id) if(!x) {x = [class new];} {[controller.view addSubview:x];[x create_SubViews:controller];x.globalize_id=id;}
#define RELEASE_NON_ICE_VIEW(x) if(x){[x removeFromSuperview];[x release];x = NULL;}
#define CREATE_NON_ICE_VIEW(x,class,controller) if(!x) {x = [class new];} {[controller.view addSubview:x];}
#define CREATE_ICE_STRING(x,class) if(!x) {x = [[class alloc] init];} 
#define CREATE_ICE_STRING_GLOBALIZE(x,class,id) if(!x) {x = [[class alloc] init];} {x.globalize_id=id;}
#define RELEASE_ICE_STRING(x) if(x){[x release];x = NULL;}
//#define CREATE_ICE_VIEW(x,class) if(x){RELEASE_ICE_VIEW(x);} {x = [class new]; [self addSubview:x];[x create_SubViews];}


#endif/* END OF #ifndef ICE_VIEW_INTERFACE_H*/